package C;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class C25 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        getResult(n,m);

    }
    public static void getResult(int n, int m) {
        ArrayList<Integer> arr = new ArrayList<>();
        for (int i=n;i<=m;i++) {
            arr.add(i*i);
        }
//        System.out.println(arr.toString());
        HashSet<Integer> set = new HashSet<>(arr);
        ArrayList<Integer[]> res = new ArrayList<>();
        for (int i=0;i<arr.size();i++) {
            for (int j = i+1;j< arr.size();j++) {
                int sum = arr.get(i)+ arr.get(j);
                if (set.contains(sum)) {
                    res.add(new Integer[]{
                            (int)Math.sqrt(arr.get(i)),(int)Math.sqrt(arr.get(j)),(int) Math.sqrt(sum)
                    });
                }
            }
        }

//        for (Integer[] g : res) {
//            if (isZhi(g[0],g[1]) && isZhi(g[0],g[2]) && isZhi(g[1],g[2])) {
//                continue;
//            }
//            res.remove(g);
//        }

        res = (ArrayList<Integer[]>) res.stream()
                .filter(g->isZhi(g[0],g[1]) && isZhi(g[0],g[2]) && isZhi(g[1],g[2]))
                .collect(Collectors.toList());


        if (res.size()==0) {
            System.out.println("NA");
        } else {
            for (Integer[] g:res) {
                System.out.println(g[0]+" "+g[1]+" "+g[2]);
            }
        }
    }
    public static boolean isZhi(int a,int b) {
        int c = 0;
        while(b!=0) {
            c = a % b;
            a = b;
            b = c;
        }
        return a==1;
    }
}
